#include "mainwindow.h"
#include "ui_mainwindow.h"
#include<QColorDialog>
#include<QPushButton>
#include<QDebug>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QPushButton*btn=new QPushButton("颜色对话框",this);
    QColorDialog*cdlg=new QColorDialog(this);

    connect(btn,&QPushButton::clicked,[=](){
            cdlg->setCurrentColor(QColor(200,100,190));
            cdlg->open();
           // qDebug()<<color.red()<<" "<<color.green()<<" "<<color.blue();
    });
}

MainWindow::~MainWindow()
{
    delete ui;
}

